<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        img{
            display: block;
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <h2>图片居中对齐</h2>
    <p>要让图片居中对齐, 可以使用 margin: auto; 并将它放到块元素中：</p>
     <img src="img/兔子.jpg" alt="111" style="width: 40%" >
</body>
</html>